
<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>
                <h1>
                    <i class='icon-cogs'></i>
                    <span>SETTINGS</span>
                </h1>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class="row-fluid">
        <div class="span12 box bordered-box blue-border">
            <div class="box-header dark-background">
                <div class="title">EMAIL SETTINGS</div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>

            <div class="box-content">
                <p>
                    <small>Email Settings</small>
                </p>



                <div class="box-content">
                    <form accept-charset="<?= Settings::get('en','charecter_set');?>" action="<?= URL::current(); ?>" class="form form-horizontal" method="post">

                        <div>
                            <?= Form::token(); ?>
                        </div>

                        <p class="text-dark-orange">
                            <?=
                            (Session::get('message') ? Session::get('message') : '');
                            ?>
                        </p>


                        <div class="control-group">
                            <label class="control-label">SMTP Mail</label>
                            <div class="controls">
                                <label class="radio inline">
                                    <input type="radio" value="1" name="opMail" <?= (Settings::get('en','mail_smtp') == '1' ? 'checked' : null)?> >
                                    Enable
                                </label>
                                <label class="radio inline">
                                    <input type="radio" value="0" name="opMail" <?= (Settings::get('en','mail_smtp') == '0' ? 'checked' : null)?> >
                                    Disable
                                </label>
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label">SMTP authentication</label>
                            <div class="controls">
                                <label class="radio inline">
                                    <input type="radio" value="1" name="opAuth" <?= (Settings::get('en','mail_smtp_auth') == '1' ? 'checked' : null)?> >
                                    Yes
                                </label>
                                <label class="radio inline">
                                    <input type="radio" value="0" name="opAuth" <?= (Settings::get('en','mail_smtp_auth') == '0' ? 'checked' : null)?> >
                                    No
                                </label>

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label"> SMTP Host <span class="text text-error">*</span></label>

                            <div class="controls">
                                <input class="input-xxlarge" name="host"
                                       value="<?= Settings::get('en','mail_smtp_host');?>" placeholder="Host"
                                       type="text" >
                                <span class="text text-error"><?php echo $errors->first('host') ?></span>
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label">SSL Enabled</label>
                            <div class="controls">
                                <label class="radio inline">
                                    <input type="radio" value="1" name="opSSL" <?= (Settings::get('en','mail_smtp_ssl') == '1' ? 'checked' : null)?> >
                                    Yes
                                </label>
                                <label class="radio inline">
                                    <input type="radio" value="0" name="opSSL" <?= (Settings::get('en','mail_smtp_ssl') == '0' ? 'checked' : null)?> >
                                    No
                                </label>

                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label"> Port <span class="text text-error">*</span></label>

                            <div class="controls">
                                <input class="input-mini" name="port"
                                       value="<?= Settings::get('en','mail_smtp_port');?>" placeholder="SMTP Port"
                                       type="text" >
                                <span class="text text-error"><?php echo $errors->first('port') ?></span>
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label"> User Name <span class="text text-error">*</span></label>

                            <div class="controls">
                                <input class="input-xlarge" name="userName"
                                       value="<?= Settings::get('en','mail_smtp_user');?>" placeholder="Email User"
                                       type="text" >
                                <span class="text text-error"><?php echo $errors->first('userName') ?></span>
                            </div>
                        </div>

                        <div class="control-group">
                            <label class="control-label"> Password <span class="text text-error">*</span></label>

                            <div class="controls">
                                <input class="input-xlarge" name="userPassword"
                                       value="<?= Settings::get('en','mail_smtp_password');?>" placeholder="Password"
                                       type="password" >
                                <span class="text text-error"><?php echo $errors->first('userPassword') ?></span>
                            </div>
                        </div>

                        <hr class="hr-normal">

                        <div class="control-group">
                            <label class="control-label">Default Email <span class="text text-error">*</span></label>

                            <div class="controls">
                                <input class="input-xlarge" name="default_email"
                                       value="<?= Settings::get('en','default_email');?>" placeholder="Default Email"
                                       type="text" >
                                <span class="text text-error"><?php echo $errors->first('default_email') ?></span>
                            </div>
                        </div>

                        <hr class="hr-normal">

                        <div class="control-group">
                            <label class="control-label"> Footer Text <span class="text text-error">*</span></label>

                            <div class="controls">
                            <textarea class="form-control input-xxlarge" name="footer" rows="2" ><?= Settings::get('en','mail_smtp_footer');?></textarea>
                               
                               <span class="text text-error"><?php echo $errors->first('footer') ?></span> 
                            </div>
                        </div>


                        <div class="form-actions">
                            <button class="btn btn-primary" type="submit" name="btnSave" value="save"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                <i class="icon-save" ></i>
                                Save
                            </button>

                            <button class="btn btn-primary" type="submit" name="btnTest" value="mail"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                                <i class="icon-envelope"></i>
                                Test Mail
                            </button>


                        </div>
                    </form>

                </div>
        </div>
    </div>


    <!-- END OF CONTENT -->
</div>
